################################################################
#                                                              #
# Disclaimer: it is recommended to run the scripts in the same #
# order as listed. Otherwise, some dependencies will not work  #
#                                                              #
################################################################


### Set a working directory if you did not store the scripts and files in a project ### 
# setwd("***") #

### Load ESS Waves 6 to 10 into the workspace ###
load("ESS6.RData")
load("ESS7.RData")
load("ESS8.RData")
load("ESS9.RData")
load("ESSten.RData")

### Load packages ###
source("Rep Packages.R", print.eval=TRUE)

### Plot Google trends ###
source("Rep Google Trends.R", print.eval=TRUE)

### Plot interview densities ###
source("Rep Interview Dates.R", print.eval=TRUE)

### Recode variables ###
source("Rep Recoding.R", print.eval=TRUE)

### RDD Main Specification at T+1 ###
source("Rep T+1.R", print.eval=TRUE)

### RDD main specification ###
source("Rep RDD.R", print.eval=TRUE)

### Power Analysis ###
source("Rep Power.R", print.eval=TRUE)

### RDD pooled meta analysis ###
source("Rep Pooled Meta Analysis.R", print.eval=TRUE)

### RDD coefficient plots ###
source("Rep Plots.R", print.eval=TRUE)

### RDD fixed and random effects meta analyses ###
source("Rep Fixed Effect Meta Analysis.R", print.eval=TRUE)

### Slope Analysis ###
source("Rep Slope Analysis.R", print.eval=TRUE)

### Non-interactive OLS ###
source("Rep OLS.R", print.eval=TRUE)

### Covariate and Non-response Balance ###
source("Rep Covariate and NR Balance Tests.R", print.eval=TRUE)

### Placebo Treatments ###
source("Rep Placebo Treatments.R", print.eval=TRUE)

### Plot migration attitudes over time ###
source("Rep Timeseries.R", print.eval=TRUE)

### Plot newspaper salience of incidents ###
source("Rep Newspapers.R", print.eval=TRUE)

### Plot P-values against uniform distribution ###
source("Rep Pvalues.R", print.eval=TRUE)

### Multiple bandwidths ###
source("Rep 5 bw.R", print.eval=TRUE)
source("Rep 10 bw.R", print.eval=TRUE)
source("Rep 20 bw.R", print.eval=TRUE)
source("Rep 40 bw.R", print.eval=TRUE)
source("Rep 50 bw.R", print.eval=TRUE)

